package com.eduction.service.impl;

import java.sql.SQLException;

import java.util.ArrayList;
import java.util.List;

import com.eduction.vo.SurveyPointCountVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.eduction.modules.system.dao.SurveyOpinionRepository;
import com.eduction.modules.system.entity.SurveyOpinion;
import com.eduction.service.SurveyOpinionService;

@Service
public class SurveyOpinionServiceImpl implements SurveyOpinionService {

	@Autowired
	private SurveyOpinionRepository surveyOpinionRepository;
	
	@Override
	public void saveSurveyOpinionInfo(List<SurveyOpinion> so) {
		surveyOpinionRepository.saveSurveyOpinionInfo(so);

	}

	@Override
	public SurveyOpinion querySurveyOpinionInfo(String expertId, String itemId, String schoolId,String expertType)
			throws SQLException {
		SurveyOpinion list = surveyOpinionRepository.querySurveyOpinionInfo(expertId, itemId, schoolId,expertType);
		return list;
	}

	@Override
	public SurveyOpinion querySurveyOpinionInfo( String itemId, String schoolId,String expertType)
			throws SQLException {
		SurveyOpinion list = surveyOpinionRepository.querySurveyOpinionInfo(itemId, schoolId,expertType);
		return list;
	}

	@Override
	public void deleteAuthIinspectionOpinionss(String schoolId, String itemId, String expertId,int type) throws SQLException {
		surveyOpinionRepository.deleteAuthIinspectionOpinionss(schoolId, itemId, expertId,type);
		
	}

	@Override
	public List<SurveyOpinion> queryAllSurveyOpinion(String schoolId, String mode) throws SQLException {
		List<SurveyOpinion> list = surveyOpinionRepository.queryAllSurveyOpinion(schoolId,mode);
		return list;
	}

	@Override
	public List<SurveyOpinion> queryItemSurveyOpinion(String schoolId, String item,String expectId) throws SQLException {
		List<SurveyOpinion> list = surveyOpinionRepository.queryItemSurveyOpinion(schoolId,item,expectId);
		return list;
	}

	@Override
	public List<SurveyPointCountVo> queryByCount( String expectType) throws SQLException{
		List<SurveyPointCountVo> list = surveyOpinionRepository.queryByCount(expectType);
//		List<SurveyPointCountVo> voList=new ArrayList<>();
//		for(Object o:list){
//			SurveyPointCountVo vo=(SurveyPointCountVo)o;
//			voList.add(vo);
//		}
		return list;
	}

}
